﻿using System;

namespace CShape_3_2
{
    class Employee
    {
        private String name;
        private int age;
        private String position;

        public Employee(String name, int age, String position)
        {
            this.name = name;
            this.age = age;
            this.position = position;
        }
        public String getName()
        {
            return name;
        }
        public int getAge()
        {
            return age;
        }
        public String getPosition()
        {
            return position;
        }
        private void setName(String name)
        {
            this.name = name;
        }
        private void setAge(int age)
        {
            this.age = age;
        }
        private void setPosition(String position)
        {
            this.position = position;
        }

        public void DisplayInfo()
        {
            Console.WriteLine("员工信息：");
            Console.WriteLine($"姓名：{name}");
            Console.WriteLine($"年龄：{age}");
            Console.WriteLine($"职位：{position}");
        }
    }
    class Program
    {
        static void Main(string[] args)
        {
            Employee emp = new Employee("张三", 25, "软件工程师");

            emp.DisplayInfo();

            Console.WriteLine("\n使用getter方法获取信息：");
            Console.WriteLine($"姓名：{emp.getName()}");
            Console.WriteLine($"年龄：{emp.getAge()}");
            Console.WriteLine($"职位：{emp.getPosition()}");
        }
    }
}